<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>prueba (RestController)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File rest_controller.rb, line 72</span>
        <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prueba</span>
                <span class="ruby-ivar">@info</span> = []
                <span class="ruby-identifier">user</span> = <span class="ruby-value str">&quot;np&quot;</span>
                <span class="ruby-identifier">results</span> = <span class="ruby-value str">''</span>
                <span class="ruby-identifier">url</span> = <span class="ruby-constant">TRAVELERNET_URL</span><span class="ruby-operator">+</span><span class="ruby-identifier">user</span>
                <span class="ruby-identifier">puts</span> <span class="ruby-identifier">url</span>
                <span class="ruby-identifier">open</span>(<span class="ruby-identifier">url</span>,<span class="ruby-value str">&quot;Accept&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;text/xml&quot;</span>) {
                  <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">results</span> = <span class="ruby-constant">XmlSimple</span><span class="ruby-operator">::</span><span class="ruby-identifier">xml_in</span>(<span class="ruby-identifier">s</span>.<span class="ruby-identifier">read</span>, <span class="ruby-value str">'force_array'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>)
                }
                <span class="ruby-identifier">puts</span> <span class="ruby-identifier">results</span>
                <span class="ruby-identifier">results</span>[<span class="ruby-value str">'object'</span>].<span class="ruby-identifier">each</span>{         
                        <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>  <span class="ruby-ivar">@info</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-node">&quot;#{p['field']}&quot;</span>]
                }
                <span class="ruby-identifier">puts</span> <span class="ruby-ivar">@info</span>
        <span class="ruby-keyword kw">end</span></pre>
</body>
</html>